{include file="public/header"/}
<link rel="stylesheet" href="{__PUBLIC_PATH}/admin/pcf/pcfbase1.css?v={$version}"/>
<script src="{__PUBLIC_PATH}/common/js/jquery.js?v={$version}"></script>
<script src="{__PUBLIC_PATH}/admin/pcf/global.js?v={$version}"></script>
<script src="{__PUBLIC_PATH}/common/js/jquery-ui.min.js?v={$version}"></script>
<script src="{__PUBLIC_PATH}/common/plugins/Ueditor/ueditor.config.js?v={$version}"></script>
<script src="{__PUBLIC_PATH}/common/plugins/Ueditor/ueditor.all.min.js?v={$version}"></script>
<script src="{__PUBLIC_PATH}/common/plugins/Ueditor/lang/zh-cn/zh-cn.js?v={$version}"></script>
</head>
<body>
<style type="text/css" media="screen">
    .pcfts{font:bold 14px/20px tahoma,verdana;color:#F60;vertical-align:middle;display:inline-block;margin-right:5px;margin-left:-14px;}
    .layui-table{width:100%!important;}
    .layui-table-cell{height:auto!important;}
    @media screen and (max-width:800px){
      .layui-table-cell{width:250px!important;padding:0!important;}
    }
    .layui-table select {border-color:#e6e6e6;height:28px;}
    .head-oper{padding:15px;line-height:24px;min-height:24px;border-bottom:1px solid #f6f6f6;margin-bottom:10px;overflow:hidden;}
    .head-oper .layui-btn-sm i{font-size:12px!important;}
    .head-oper .fr select{height:35px;line-height:35px;border:1px solid #e6e6e6;color:#495057;}
    .head-oper .title-info{margin:0 10px;}
</style>
<div class="layui-fluid" style="padding-bottom:68px;" id="LAY-component-layer-list">
<form class="layui-form" id="pcfcms-form" onsubmit="return false;">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-form-item layui-row">
                <div class="head-oper">
                    {notempty name='$gourl'}
                    <div class="fl">
                    <a href="{$gourl}" class="layui-btn layui-btn-primary input-btn-back"><i class="layui-icon layui-icon-left"></i></a>
                    </div>
                    {/notempty}  
                    <div class="fl" style="line-height:38px;min-height:38px;margin-left:1%;">{$info.typename|default=''} - 内容管理</div>  
                </div>
                {include file="channel/field/addonextitem"/}
                <input type="hidden" name="gourl" value="{$gourl}">
                <input type="hidden" name="typeid" id="typeid" value="{$info.id|default=''}">
            </div>
        </div>
    </div>
    <div class="submit-info text-center">
        <button class="layui-btn" lay-submit lay-filter="formSubmit">确认提交</button>
        <a class="layui-btn layui-btn-primary" href="{$gourl}">返回</a>
    </div>
</form>
</div>
{include file="public/footer"/}
<script>
    layui.use(['layer', 'form','element'], function () {
        var $ = layui.$,
            element = layui.element,
            layer = layui.layer,
            form = layui.form;
        //监听提交
        form.on('submit(formSubmit)', function(data){
            layer_loading('正在处理');
            var pcfdata = $("#pcfcms-form").serialize();
            $.ajax({
                type : 'post',
                url : "{:url('/arctype/single_edit')}",
                data : pcfdata,
                dataType : 'json',
                success : function(res){
                    layer.closeAll('loading');
                    if(res.status){
                        layer.msg(res.msg, {icon: 1, time: 1000}, function(){
                            window.location.href = res.url;
                        });
                    }else{
                        layer.msg(res.msg, {icon: 2, time: 1000});
                    }
                },
                error: function(e){
                    layer.closeAll('loading');
                    layer.msg("未知错误，操作中断！", {icon: 2, time: 1000});
                }
            });
            return false;
        });
    });
</script>